package com.nancy.java_design.decorator.demo1;

/**
 * 装饰器设计模式
 * 测试
 */
public class Cilent {
    public static void main(String[] args) {
        //面条
       FastFood fastFood1 = new FastFoodNoodle();
       System.out.println("面条价格：" + fastFood1.cost());

       //面条+鸡蛋
        fastFood1 = new Eggdecorator(fastFood1);
       System.out.println("面条+鸡蛋价格：" + fastFood1.cost());

       //米饭+肉丝
        FastFood fastFood2 = new FastFoodRice();
        fastFood2 = new Meatdecorator(fastFood2);
        System.out.println("米饭+肉丝价格：" + fastFood2.cost());
    }
}
